
/**
 * The UserVo connected in the server-side application.
 */
if ( ewhiteboard.vo.UserVO == undefined ) 
{

	/**
	 * @requires andromeda.model.AbstractValueObject
	 */
	require("andromeda.model.AbstractValueObject") ;
	
	/**
	 * Creates a new UserVO instance.
	 * @param name The optional name of the user.
	 * @param client The optional Client reference of the user.
	 */
	ewhiteboard.vo.UserVO = function( name /*String*/ , client /*Client*/ )
	{
		
		andromeda.model.AbstractValueObject.call( this ) ; // super
		
		if ( arguments.length > 0 )
		{
			this.name   = name   || null ;
			this.client = client || null ;
			
			 // hack to find the user in the user model
			if (this.client != null)
			{
				this.client.name = this.name ;
				this.client.id   = this.id ;
			}
			 
		}
		
	}
	
	/**
	 * @extends andromeda.model.AbstractValueObject
	 */
	proto = ewhiteboard.vo.UserVO.extend( andromeda.model.AbstractValueObject ) ;
	
	/**
	 * The Client reference of the user.
	 */
	proto.client /*Client*/ = null ;	
	
	/**
	 * The name of the user.
	 */
	proto.name /*String*/ = null ;

	/**
	 * Returns {@code true} if this object it's the same like the specified object in argument.
	 * @return {@code true} if this object it's the same like the specified object in argument.
	 */
	proto.equals = function( o )
	{
		if (o instanceof UserVO || o instanceof  ewhiteboard.vo.UserVO )
		{
			return o.id == this.id ;			
		}
		else
		{
			return false ;
		}
	}
	
	/**
	 * Returns the string representation of this instance.
	 * @return the string representation of this instance
	 */
	proto.toString = function() /*String*/ 
	{
		return "[UserVO id:" + this.id + ", name:" + this.name + "]";
	}
	
	delete proto ;
	
	// Register the class to AMF exchange.
	
	function UserVO()
	{
		ewhiteboard.vo.UserVO.apply( this , Array.fromArguments( arguments ) ) ;
	}
	
	UserVO.extend( ewhiteboard.vo.UserVO ) ;

	application.registerClass("UserVO", UserVO) ;

}